#include<bits/stdc++.h>
using namespace std;

int main()
{
	int t;
	cin>>t;
	while(t--)
	{
		double p,g,b,m;
		cin>>p>>g>>b>>m;
		long double sum = p+g+b+m;
		long double ret = (p+g*0.65)/sum;
		printf("%.2llf\n",100*ret);
	} 
	return 0;
}
